package com.rew.canteenbox.functions;

import android.content.Context;
import android.widget.Toast;
import com.rew.canteenbox.R;
import com.rew.canteenbox.activities.MainActivity;

/**
 *  Login account-password check.
 *
 * Created by HuiWen Ren on 2016/10/19.
 */
public class LoginAssert {

    private static boolean checkPassword(String account,String password){
        return account.equals("123456") && password.equals("123456");
    }

    public static void  loginAssert(Context context,
                                      String account, String password){
        if (checkPassword(account,password)) {
            Toast.makeText(context,"登录成功",
                    Toast.LENGTH_SHORT).show();
            MainActivity.inStyle = R.anim.in_from_right;
            MainActivity.outStyle = R.anim.out_from_left;
            MainActivity.actionStart(context);
        } else {
            Toast.makeText(context, "账号或密码错误",
                    Toast.LENGTH_SHORT).show();
        }
    }
}
